package com.example.springbootv1.service.impl;

import com.example.springbootv1.mapper.LoginLogMapper;
import com.example.springbootv1.pojo.LoginLog;
import com.example.springbootv1.service.LoginLogService;
import com.example.springbootv1.util.ExcelUtil;
import jakarta.servlet.http.HttpServletResponse;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.InputStream;
import java.io.OutputStream;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
@Service
public class LoginLogServiceImpl implements LoginLogService {
    @Autowired
    private LoginLogMapper loginLogMapper;
    @Override
    public List<LoginLog> getLoginLogList() {
        return loginLogMapper.getLoginLogList();
    }

    @Override
    public LoginLog queryByLoginLogId(Long loginLogId) {
        return loginLogMapper.queryByLoginLogId(loginLogId);
    }

    @Override
    public int insertLoginLog(LoginLog loginLog) {
        System.out.println(loginLog);
        int count = loginLogMapper.insertLoginLog(loginLog);
        // 必须在调用之后才有主键
        System.out.println(loginLog);
        return count;
    }

    @Override
    public int updateLoginLog(LoginLog loginLog) {
        return loginLogMapper.updateLoginLog(loginLog);
    }

    @Override
    public int deleteLoginLogById(Long loginLogId) {
        return loginLogMapper.deleteLoginLogById(loginLogId);
    }

    @Override
    public LoginLog login(String loginLogName, String loginLogFlag) {
        return loginLogMapper.login(loginLogName, loginLogFlag);
    }

    @Override
    public List<LoginLog> getLoginLogByLoginLog(LoginLog loginLog) {
        return loginLogMapper.getLoginLogByLoginLog(loginLog);
    }

    @Override
    public List<LoginLog> getLoginLogByFenYe(LoginLog loginLog) {
        return loginLogMapper.getLoginLogByFenYe(loginLog);
    }

    @Override
    public int deleteLoginLogBatch(List<Long> loginLogIds) {
        return loginLogMapper.deleteLoginLogBatch(loginLogIds);
    }

    @Override
    public List<LoginLog> getLoginLogBatch(Long[] loginLogIds) {
        return loginLogMapper.getLoginLogBatch(loginLogIds);
    }


}
